[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MENU HOOKS
     To use a procedure as a menu hook it must:

     1) Be a procedure declared with three passed parameters - a variable
     character, an integer and a variable integer. For example,

          PROCEDURE BOBS_HOOK(VAR C:CHAR;TOPIC:INTEGER;VAR ERROR:INTEGER);
          BEGIN
              .............
          END;

     2) Be declared as a far procedure, i.e. precede the procedure with a
     {$F+} compiler directive and succeed the procedure with the {$F-}
     compiler directive.

     The technique of assigning or hooking the procedure for Turbo Pascal
     5.0 is different from version 4.0:

     Turbo 5 Users - the Menu_Record variable includes a field HOOK which
     should be set to the procedure name, e.g.

          MYMENU.HOOK := BOBS_HOOK;

     Turbo 4 Users - a global variable Hook (of type Pointer) should point
     to the procedure with the @ directive, e.g.

          HOOK := @BOBS_HOOK


     The Hooked procedure will be passed the character the user just
     pressed, the currently highlighted topic and an integer error code.
     The Hooked procedure can update both the character pressed and the
     error code. If the character is changed to a null (i.e. #0) then the
     menu session will be automatically terminated and the DisplayMenu
     procedure will return the error code that was set by the Hooked
     procedure.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson